Pass gthread on to gtk-config.
authorOwen Taylor <otaylor@redhat.com>
Mon, 1 Feb 1999 23:17:39 +0000 (23:17 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Mon, 1 Feb 1999 23:17:39 +0000 (23:17 +0000)
Mon Feb  1 16:47:55 1999  Owen Taylor  <otaylor@redhat.com>

* gtk.m4: Pass gthread on to gtk-config.

* configure.in gtk-config.in: Support gthread flag to
  add thread cflags/libraries into the output of
  gtk-config.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
configure.in
gtk-config.in
gtk.m4

index 4a070c104e44fb54565f24b27820d83bb6b4546c..a849596cc53ff985edb12aa797bc43ea0469c71c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Mon Feb  1 16:47:55 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk.m4: Pass gthread on to gtk-config.
+
+       * configure.in gtk-config.in: Support gthread flag to 
+         add thread cflags/libraries into the output of 
+         gtk-config.
+
 Mon Feb  1 15:14:56 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): 
index 4a070c104e44fb54565f24b27820d83bb6b4546c..a849596cc53ff985edb12aa797bc43ea0469c71c 100644 (file)
@@ -1,3 +1,11 @@
+Mon Feb  1 16:47:55 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk.m4: Pass gthread on to gtk-config.
+
+       * configure.in gtk-config.in: Support gthread flag to 
+         add thread cflags/libraries into the output of 
+         gtk-config.
+
 Mon Feb  1 15:14:56 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): 
index 4a070c104e44fb54565f24b27820d83bb6b4546c..a849596cc53ff985edb12aa797bc43ea0469c71c 100644 (file)
@@ -1,3 +1,11 @@
+Mon Feb  1 16:47:55 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk.m4: Pass gthread on to gtk-config.
+
+       * configure.in gtk-config.in: Support gthread flag to 
+         add thread cflags/libraries into the output of 
+         gtk-config.
+
 Mon Feb  1 15:14:56 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): 
index 4a070c104e44fb54565f24b27820d83bb6b4546c..a849596cc53ff985edb12aa797bc43ea0469c71c 100644 (file)
@@ -1,3 +1,11 @@
+Mon Feb  1 16:47:55 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk.m4: Pass gthread on to gtk-config.
+
+       * configure.in gtk-config.in: Support gthread flag to 
+         add thread cflags/libraries into the output of 
+         gtk-config.
+
 Mon Feb  1 15:14:56 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): 
index 4a070c104e44fb54565f24b27820d83bb6b4546c..a849596cc53ff985edb12aa797bc43ea0469c71c 100644 (file)
@@ -1,3 +1,11 @@
+Mon Feb  1 16:47:55 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk.m4: Pass gthread on to gtk-config.
+
+       * configure.in gtk-config.in: Support gthread flag to 
+         add thread cflags/libraries into the output of 
+         gtk-config.
+
 Mon Feb  1 15:14:56 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): 
index 4a070c104e44fb54565f24b27820d83bb6b4546c..a849596cc53ff985edb12aa797bc43ea0469c71c 100644 (file)
@@ -1,3 +1,11 @@
+Mon Feb  1 16:47:55 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk.m4: Pass gthread on to gtk-config.
+
+       * configure.in gtk-config.in: Support gthread flag to 
+         add thread cflags/libraries into the output of 
+         gtk-config.
+
 Mon Feb  1 15:14:56 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): 
index 4a070c104e44fb54565f24b27820d83bb6b4546c..a849596cc53ff985edb12aa797bc43ea0469c71c 100644 (file)
@@ -1,3 +1,11 @@
+Mon Feb  1 16:47:55 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk.m4: Pass gthread on to gtk-config.
+
+       * configure.in gtk-config.in: Support gthread flag to 
+         add thread cflags/libraries into the output of 
+         gtk-config.
+
 Mon Feb  1 15:14:56 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): 
index 589a55a9450ba305bcc55b6571e27edf96de17fc..26b52ff3439f1dee749540261e6f8d7c2de71f15 100644 (file)
@@ -1,6 +1,17 @@
 # Process this file with autoconf to produce a configure script.
 AC_INIT(gdk/gdktypes.h)
 
+# In the following, there are a the following variants
+# of GLib cflags and libs variables
+#
+# GLIB_CFLAGS:  cflags for compiling libraries and example progs
+# GLIB_LIBS:    libraries for linking example programs
+# GLIB_DEPLIBS: libraries for linking libraries against
+# glib_cflags:  cflags to store in gtk-config
+# glib_libs:    libs to store in gtk-config
+# glib_thread_cflags: cflags to store in gtk-config for gtk-config gthread
+# glib_thread_libs:   libs to store in gtk-config for gtk-config gthread
+
 # Save this value here, since automake will set cflags later
 cflags_set=${CFLAGS+set}
 
@@ -193,7 +204,9 @@ if test x$with_glib = x ; then
 
   # we do not want to make all gtk progs to link to thread libraries.
   glib_cflags=`$GLIB_CONFIG glib gmodule --cflags`
+  glib_thread_cflags="$GLIB_CFLAGS"
   glib_libs=`$GLIB_CONFIG glib gmodule --libs`
+  glib_thread_libs="$GLIB_LIBS"
   GLIB_LIBS="$glib_libs"
   GLIB_DEPLIBS="$glib_libs"
 else
@@ -208,7 +221,9 @@ else
 
   # For use in gtk-config
   glib_cflags=`$GLIB_CONFIG --cflags gmodule`
+  glib_thread_cflags=`$GLIB_CONFIG --cflags gmodule gthread`
   glib_libs=`$GLIB_CONFIG --libs gmodule`
+  glib_thread_libs=`$GLIB_CONFIG --libs gmodule gthread`
 
   glib_release=`$GLIB_CONFIG --version | sed 's%\\.[[0-9]]*$%%'`
 
@@ -232,6 +247,8 @@ fi
 
 AC_SUBST(glib_cflags)
 AC_SUBST(glib_libs)
+AC_SUBST(glib_thread_cflags)
+AC_SUBST(glib_thread_libs)
 AC_SUBST(GLIB_DEPLIBS)
 
 # Find the X11 include and library directories
index f20dd7154231a99997e8b9a3acc9eb434ecb0fe7..f056c3a42360e677c20433ef9bd0f960f3d317ae 100644 (file)
@@ -2,19 +2,36 @@
 
 glib_libs="@glib_libs@"
 glib_cflags="@glib_cflags@"
+glib_thread_libs="@glib_thread_libs@"
+glib_thread_cflags="@glib_thread_cflags@"
 
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 exec_prefix_set=no
 
-usage="\
-Usage: gtk-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]"
+usage()
+{
+       cat <<EOF
+Usage: gtk-config [OPTIONS] [LIBRARIES]
+Options:
+       [--prefix[=DIR]]
+       [--exec-prefix[=DIR]]
+       [--version]
+       [--libs]
+       [--cflags]
+Libraries:
+       gtk
+       gthread
+EOF
+       exit $1
+}
 
 if test $# -eq 0; then
-      echo "${usage}" 1>&2
-      exit 1
+       usage 1 1>&2
 fi
 
+lib_gtk=yes
+
 while test $# -gt 0; do
   case "$1" in
   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
@@ -29,19 +46,51 @@ while test $# -gt 0; do
       fi
       ;;
     --prefix)
-      echo $prefix
+      echo_prefix=yes
       ;;
     --exec-prefix=*)
       exec_prefix=$optarg
       exec_prefix_set=yes
       ;;
     --exec-prefix)
-      echo $exec_prefix
+      echo_exec_prefix=yes
       ;;
     --version)
       echo @GTK_VERSION@
       ;;
     --cflags)
+      echo_cflags=yes
+      ;;
+    --libs)
+      echo_libs=yes
+      ;;
+    gtk)
+      lib_gtk=yes
+      ;;
+    gthread)
+      lib_gthread=yes
+      ;;
+    *)
+      usage 1 1>&2
+      ;;
+  esac
+  shift
+done
+
+if test "$echo_prefix" = "yes"; then
+       echo $prefix
+fi
+
+if test "$echo_exec_prefix" = "yes"; then
+       echo $exec_prefix
+fi
+
+if test "$lib_gthread" = "yes"; then
+      glib_cflags="$glib_thread_cflags"
+      glib_libs="$glib_thread_libs"
+fi
+
+if test "$echo_cflags" = "yes"; then
       if test @includedir@ != /usr/include ; then
         includes=-I@includedir@
         for i in $glib_cflags ; do
@@ -51,8 +100,9 @@ while test $# -gt 0; do
         done
       fi
       echo $includes @x_cflags@ $glib_cflags
-      ;;
-    --libs)
+fi
+
+if test "$echo_libs" = "yes"; then
       my_glib_libs=
       libdirs=-L@libdir@
       for i in $glib_libs ; do
@@ -64,13 +114,7 @@ while test $# -gt 0; do
           fi
         fi
       done
+
       echo $libdirs @x_ldflags@ -lgtk -lgdk $my_glib_libs @INTLLIBS@ @x_libs@ @GDK_WLIBS@ -lm
-      ;;
-    *)
-      echo "${usage}" 1>&2
-      exit 1
-      ;;
-  esac
-  shift
-done
+fi      
 
diff --git a/gtk.m4 b/gtk.m4
index 6cce827ea92d98cdd4639e95b967a1c4b9af1603..9f6b766e123c251c1574049e3f38582dd3713bd5 100644 (file)
--- a/gtk.m4
+++ b/gtk.m4
@@ -1,7 +1,7 @@
 # Configure paths for GTK+
 # Owen Taylor     97-11-3
 
-dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
 dnl
 AC_DEFUN(AM_PATH_GTK,
@@ -15,6 +15,15 @@ AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK
 AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
                    , enable_gtktest=yes)
 
+  for module in . $4
+  do
+      case "$module" in
+         gthread) 
+             glib_config_args="$glib_config_args gthread"
+         ;;
+      esac
+  done
+
   if test x$gtk_config_exec_prefix != x ; then
      gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
      if test x${GTK_CONFIG+set} != xset ; then